home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / hurd / Makefile < prev    next >
Makefile  |  1994-05-27  |  4KB  |  125 lines

  1. # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License
  6. # as published by the Free Software Foundation; either version 2 of
  7. # the License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. subdir := hurd
  20.  
  21. all:
  22.  
  23. # Some things below (but before including Rules) use configuration variables.
  24. include ../Makeconfig
  25.  
  26.  
  27. headers = hurd.h $(interface-headers) \
  28.       $(addprefix hurd/,fd.h id.h port.h signal.h userlink.h \
  29.                     resource.h threadvar.h)
  30.  
  31. distribute := intr_rpc.awk hurdintr.awk
  32.  
  33. # The RPC interfaces go in a separate library.
  34. interface-library := libhurduser.a
  35. user-interfaces        := $(addprefix hurd/,\
  36.                        auth process startup \
  37.                        msg msg_reply msg_request \
  38.                        exec core interrupt \
  39.                        fs fsys io term socket )
  40. server-interfaces    := hurd/msg
  41.  
  42. routines = hurdid hurdpath hurdpid hurdports hurdrlimit \
  43.        hurdexec \
  44.        __setauth setauth \
  45.        __pid2task __task2pid pid2task task2pid \
  46.        getuids setuids getumask fchroot \
  47.        hurdsock hurdauth \
  48.        privports \
  49.        msgportdemux \
  50.        fopenport __fopenport \
  51.         vpprintf \
  52.        $(sig) $(dtable) $(inlines)
  53. sig    = hurdsig siginfo init-fault msging-p hurd-raise preempt-sig \
  54.       trampoline longjmp-ctx longjmp-ts catch-exc exc2signal
  55. dtable    = dtable port2fd new-fd alloc-fd intern-fd \
  56.       __getdport getdport openport \
  57.       fd-close fd-read fd-write hurdioctl
  58. inlines = $(addprefix inline-,fd port signal userlink threadvar)
  59. aux := hurdsyms hurdinit msgstub # hurdmsg
  60.  
  61. # The files inline-*.c contain the real-function definitions of the
  62. # functions defined with `extern inline' in hurd/*.h.
  63. $(inlines:%=$(objpfx)%.c): $(objpfx)inline-%.c: 
  64.     (echo '#define _EXTERN_INLINE /* Define the real function. */';\
  65.      echo '#include "hurd/$*.h"') > $@-tmp
  66.     mv $@-tmp $@
  67. generated += $(inlines:%=%.c)
  68.  
  69. # XXX this is a temporary hack; see hurdmalloc.h
  70. routines += hurdmalloc
  71. distribute += hurdmalloc.h
  72.  
  73. # Get the proper definition of `hurd-srcdir'.
  74. include ../sysdeps/mach/hurd/Makefile
  75.  
  76. # Use and install the Hurd header files directly out of the Hurd source.
  77.  
  78. # Find the MiG defs files in the Hurd source.
  79. vpath %.defs $(hurd-srcdir)
  80.  
  81. # Install all .h and .defs files we find in the Hurd's hurd/ directory.
  82. hurd-headers := $(patsubst $(hurd-srcdir)/%,%,\
  83.                $(wildcard $(addprefix $(hurd-srcdir)/hurd/,\
  84.                           *.defs *.h)))
  85.  
  86.  
  87. # Don't distribute the Hurd headers; they are in the Hurd distribution.
  88. dont_distribute = $(hurd-headers)
  89.  
  90. # DO NOT try to remake these in any way!!!
  91. $(addprefix $(hurd-srcdir)/,$(hurd-headers)) : ;
  92. install-others += $(addprefix $(includedir)/,$(hurd-headers))
  93. $(includedir)/hurd/%: $(hurd-srcdir)/hurd/%; $(do-install)
  94.  
  95. # Insert comment here.
  96.  
  97. ifdef intrhack # XXX
  98. # This rule needs to come before the implicit rules in Machrules.
  99. __%.c: intr_rpc.awk %_rpc.c
  100.     gawk -v call=__$* -v rpc=__$*_rpc -f $^ > $@-new
  101.     mv $@-new $@
  102. # __%_rpc.c is made with mig by Machrules.
  103. %_rpc.c: __%_rpc.c
  104.     sed s/MACH_MSG_OPTION_NONE/MACH_SEND_INTERRUPT/ $< > $@
  105. endif
  106.  
  107. include ../mach/Machrules
  108.  
  109. ifdef intrhack # XXX
  110. ifdef user-interfaces
  111. include hurdintr
  112. endif
  113. hurdintr: hurdintr.awk $(user-interfaces:%=%.defs)
  114.     awk -f $^ varname=intr-calls > $@-new
  115.     mv $@-new $@
  116.  
  117. # Make the INTR user stubs be defined as CALL_rpc.
  118. migdefines := $(migdefines) $(foreach call,$(intr-calls),-D$(call)=$(call)_rpc)
  119.  
  120. interface-routines := $(filter-out %_rpc,$(interface-routines)) \
  121.               $(intr-calls:%=__% %)
  122. endif
  123.  
  124. include ../Rules
  125.